package com.example.azheng.rxjavamvpdemo.ui.fragment;

import android.support.constraint.ConstraintLayout;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioGroup;
import android.widget.TextView;

import com.example.azheng.rxjavamvpdemo.R;
import com.example.azheng.rxjavamvpdemo.base.BaseFragment;

import butterknife.BindView;

/**
 * Time:2020/5/19
 * Author:ypf
 * Description:
 */
public class WithdrawFragment extends BaseFragment {
    @BindView(R.id.rg_pay_type)
    RadioGroup rgPayType;//提现方式
    @BindView(R.id.tv_bind_card_type)
    TextView bindCardType;
    @BindView(R.id.iv_bind_card_type)
    ImageView ivBindCardType;
    @BindView(R.id.tv_account)
    TextView tvAccount;
    @BindView(R.id.ed_account)
    EditText edAccount;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.ed_name)
    EditText edName;
    @BindView(R.id.cl_hint)
    ConstraintLayout cl_hint;


    @Override
    protected void initView(View view) {
        rgPayType.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                switch (i){
                    case R.id.rb_zfb:
                        bindCardType.setText("请绑定支付宝");
                        ivBindCardType.setImageResource(R.mipmap.ic_zfb);
                        tvAccount.setText("支付宝账号");
                        edAccount.setHint("输入支付宝账号");
                        tvName.setText("收款人姓名");
                        edName.setHint("输入收款人姓名");
                        cl_hint.setVisibility(View.GONE);
                        break;
                    case R.id.rb_bank:
                        bindCardType.setText("请绑定银行卡");
                        ivBindCardType.setImageResource(R.mipmap.ic_withdraw_bank_cion);
                        tvAccount.setText("银行卡号");
                        edAccount.setHint("输入银行卡号");
                        tvName.setText("开户银行");
                        edName.setHint("输入开户银行");
                        cl_hint.setVisibility(View.VISIBLE);
                        break;
                }
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_withdraw;
    }
}
